package com.superc.shared.util;

public class StringHelper {

	public static String SubString(String data,int startIndex,int endIndex){
		if(data!=null){
			if(startIndex>endIndex){
				int startIndexTemp=endIndex;
				endIndex=startIndex;
				startIndex=startIndexTemp;
			}
			if(startIndex<0) startIndex=0;
			if(endIndex>data.length()) endIndex=data.length();
			return data.substring(startIndex,endIndex);
		}
		return null;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(StringHelper.SubString("ab", 1, 3));
	}

}
